# reduce函数

from functools import reduce

tuple = (21,24,12,10,9,8)
result1 = reduce(lambda x,y : x+y,tuple)
print(result1)

tuple = (2,)
result2 = reduce(lambda x,y : x+y,tuple,20)
print(result2)